(function() {
	var $ = require(L('$')), _ = require(L('_'));

	var win = $.createWindow(L('win_setting_details'));
	win.navbar = $.ui('navbar')(true, false);
	var view = Ti.UI.createWebView({
		top : L('nav_bar_height'),
		width : '280dip',
		height : $.isLoggedIn() ? $.mainContentHeight() : Ti.UI.FILL,
		backgroundColor : 'transparent',
		hideShadow : true,
		html : ''
	});
	win.add([win.navbar, view]);

	win.update = function(index, canGoBack, overwriteBack) {
		if (canGoBack === false)
			win.navbar.update(false, true);
		win.navbar.overwriteBack(overwriteBack);
		var staticContent = $.getStaticContent();
		if (index == L('code_how_it_work')) {
			view.html = staticContent.HowItWork;
		} else if (index == L('code_who_involved')) {
			view.html = staticContent.WhoInvolved;
		} else if (index == L('code_privacy_policy')) {
			view.html = staticContent.PrivacyPolicy;
		} else if (index == L('code_security_policy')) {
			view.html = staticContent.SecurityPolicy;
		} else if (index == L('code_terms_and_conditions')) {
			view.html = staticContent.TermsAndConditions;
		} else if (index == L('code_faq')) {
			view.html = staticContent.FAQ;
		}
	};

	module.exports = win;
})();
